*******************************************************************
*******************************************************************
*******													***********
*******       Shaking Hands with The Internal Enemy	    ***********
*******		     International Studies Quarterly        ***********
*******					Omer Zarpli 					***********
*******					 July 2020						***********
*******													***********
*******************************************************************
*******************************************************************
log using Zarpli_2020, name(Main_Replication) 
*use "mainreplication.dta" 
set scheme plotplain

*** Figure 1 ***
hist v2x_libdem

*** Table 1 ***
*model1
logit negotiate c.vdemlag##c.vdemlag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility  _spline1 _spline2 _spline3, robust cluster (ccode) 


*** Figure 2 ***
margins, at(vdemlag==(0(0.1)0.9)) atmeans
marginsplot, level(90)

*** Table 1 ***
*model 2*
logit negotiate c.vdemlag##c.vdemlag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility lag2v2elpeace mediation _spline1 _spline2 _spline3, robust cluster (ccode)

*** Table 2 ***
*model 1*
logit negotiate vanocracylag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility  _spline1 _spline2 _spline3, robust cluster (ccode) 

*** Figure 3 ***
margins, at(vanocracylag==(0 1)) atmeans
marginsplot, level(90) recast(bar)

*** Table 2 ***
*model 2*
logit negotiate vanocracylag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility lag2v2elpeace mediation _spline1 _spline2 _spline3, robust cluster (ccode) 


*************************************************
*********     Online Appendix        ************
*************************************************

*** Table A3 ***
*Model 1a*
logit negotiate c.vdemlag##c.vdemlag batlleln e_migdppcln lnpop2 warduration CumulativeIntensity Incompatibility  _spline1 _spline2 _spline3, robust cluster (ccode) 
*Model 2a*
logit negotiate c.vdemlag##c.vdemlag batlleln e_migdppcln lnpop2 warduration CumulativeIntensity Incompatibility lag2v2elpeace mediation _spline1 _spline2 _spline3, robust cluster (ccode) 

*** Table A4 ***
logit negotiate c.v2x_polyarchy##c.v2x_polyarchy batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility v2elpeace mediation _spline1 _spline2 _spline3, robust cluster (ccode)

*** Table A6 ***
*model 1*
logit negotiate c.vdemlag##c.vdemlag  batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility ethfrac relfrac Oil _spline1 _spline2 _spline3, robust cluster (ccode)

*model 2*
logit negotiate vanocracylag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility ethfrac relfrac Oil _spline1 _spline2 _spline3, robust cluster (ccode)

*** Table A7 ***
*model 1*
logit negotiate c.vdemlag##c.vdemlag  batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility mediation newyear newyear2 newyear3  _spline1 _spline2 _spline3, robust cluster (ccode) 

*model 2*
logit negotiate vanocracylag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility mediation newyear newyear2 newyear3  _spline1 _spline2 _spline3, robust cluster (ccode) 

*** Table A8 ***
*Model1
stcrreg c.vdemlag##c.vdemlag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility mediation _spline1 _spline2 _spline3, compete(newoutcome==2,3,4,5) vce(cluster ccode) noshr
*Model2
stcrreg c.vdemlag##c.vdemlag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility mediation newyear newyear2 newyear3 _spline1 _spline2 _spline3, compete(newoutcome==2,3,4,5) vce(cluster ccode) noshr
*Model3
stcrreg vanocracylag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility mediation _spline1 _spline2 _spline3, compete(newoutcome==2,3,4,5) vce(cluster ccode) noshr
*Model4
stcrreg vanocracylag batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility mediation  newyear newyear2 newyear3 _spline1 _spline2 _spline3, compete(newoutcome==2,3,4,5) vce(cluster ccode) noshr


*** Table A9 ***
mlogit Outcome c.v2x_libdem##c.v2x_libdem batlleln lngdp lnpop2 warduration CumulativeIntensity Incompatibility _spline1 _spline2 _spline3, robust cluster (ccode)


log close Main_Replication
translate Zarpli_2020.smcl Zarpli_2020.pdf
